package de.gof.ppstool.kundenauftragsverwaltung.db;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The persistent class for the prognose database table.
 */
@Entity
@Table(name = "prognose")
@NamedQueries({
		@NamedQuery(name = Prognose.FINDE_ALLE_PROGNOSEN, query = "SELECT DISTINCT p FROM Prognose p"),
		@NamedQuery(name = Prognose.FINDE_PROGNOSE_NACH_FAHRRADART_UND_PERIODE, query = "SELECT p FROM Prognose p WHERE p.fahrradart = :"
				+ Prognose.PARAM_FAHRRADART
				+ " AND p.periodennr = :"
				+ Prognose.PARAM_PERIODE) })
public class Prognose implements Serializable {
	private static final long serialVersionUID = 1L;
	/**
	 * ++++++++++++++++++++++++++++++++++++++++++
	 * ++++ Attribute von der Klasse Prognose +++
	 * ++++++++++++++++++++++++++++++++++++++++++
	 */
	public static final String FINDE_ALLE_PROGNOSEN = "findeAllePrognosen";
	public static final String FINDE_PROGNOSE_NACH_FAHRRADART_UND_PERIODE = "findePrognoseNachFahrradartUndPeriode";
	public static final String PARAM_FAHRRADART = "fahrradart";
	public static final String PARAM_PERIODE = "periodennr";
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "prognose_sequence_name")
	@SequenceGenerator(name = "prognose_sequence_name", sequenceName = "prognose_prognose_id_seq", allocationSize = 1)
	@Column(unique = true, nullable = false)
	private Long prognose_id;
	@Column(length = 2147483647)
	private Integer datenx;
	@Column(length = 2147483647)
	private Integer dateny;
	@Column(length = 2147483647)
	private Integer datenz;
	@Column(nullable = false, length = 2147483647)
	private String fahrradart;
	@Column(nullable = false, length = 2147483647)
	private String periodennr;

	/**
	 * ++++++++++++++++++++++++++++++++++++++++++
	 * +++++ Konstruktoren der Klasse Prognose+++
	 * ++++++++++++++++++++++++++++++++++++++++++
	 */
	public Prognose() {
		super();
	}

	public Prognose(Long prognose_id, Integer datenx, Integer dateny,
			Integer datenz, String fahrradart, String periodennr) {
		super();
		this.prognose_id = prognose_id;
		this.datenx = datenx;
		this.dateny = dateny;
		this.datenz = datenz;
		this.fahrradart = fahrradart;
		this.periodennr = periodennr;
	}

	/**
	 * +++++++++++++++++++++++++++++	
	 * +++++ Getter und Setter +++++
	 * +++++++++++++++++++++++++++++
	 */
	public Long getPrognose_id() {
		return this.prognose_id;
	}

	public void setPrognose_id(Long prognose_id) {
		this.prognose_id = prognose_id;
	}

	/**
	 * Daten der Periode n+1
	 * @return
	 */
	public Integer getDatenx() {
		return this.datenx;
	}

	public void setDatenx(Integer datenx) {
		this.datenx = datenx;
	}

	/**
	 * Daten der Periode n+2
	 * @return
	 */
	public Integer getDateny() {
		return this.dateny;
	}

	public void setDateny(Integer dateny) {
		this.dateny = dateny;
	}

	/**
	 * Daten der Periode n+3
	 * @return
	 */
	public Integer getDatenz() {
		return this.datenz;
	}

	public void setDatenz(Integer datenz) {
		this.datenz = datenz;
	}

	/**
	 * Fahrradarten:
	 * P1: Kinderfahrrad
	 * P2: Damenfahrrad
	 * P3: Herrenfahrrad
	 * @return
	 */
	public String getFahrradart() {
		return this.fahrradart;
	}

	public void setFahrradart(String fahrradart) {
		this.fahrradart = fahrradart;
	}

	public String getPeriodennr() {
		return this.periodennr;
	}

	public void setPeriodennr(String periodennr) {
		this.periodennr = periodennr;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((datenx == null) ? 0 : datenx.hashCode());
		result = prime * result + ((dateny == null) ? 0 : dateny.hashCode());
		result = prime * result + ((datenz == null) ? 0 : datenz.hashCode());
		result = prime * result
				+ ((fahrradart == null) ? 0 : fahrradart.hashCode());
		result = prime * result
				+ ((periodennr == null) ? 0 : periodennr.hashCode());
		result = prime * result
				+ ((prognose_id == null) ? 0 : prognose_id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;

		if (obj == null)
			return false;

		if (getClass() != obj.getClass())
			return false;

		Prognose other = (Prognose) obj;
		if (datenx == null) {
			if (other.datenx != null)
				return false;

		} else if (!datenx.equals(other.datenx))
			return false;

		if (dateny == null) {
			if (other.dateny != null)
				return false;

		} else if (!dateny.equals(other.dateny))
			return false;

		if (datenz == null) {
			if (other.datenz != null)
				return false;

		} else if (!datenz.equals(other.datenz))
			return false;

		if (fahrradart == null) {
			if (other.fahrradart != null)
				return false;

		} else if (!fahrradart.equals(other.fahrradart))
			return false;

		if (periodennr == null) {
			if (other.periodennr != null)
				return false;

		} else if (!periodennr.equals(other.periodennr))
			return false;

		if (prognose_id == null) {
			if (other.prognose_id != null)
				return false;

		} else if (!prognose_id.equals(other.prognose_id))
			return false;

		return true;
	}

	@Override
	public String toString() {
		return "Prognose [prognose_id=" + prognose_id + ", datenx=" + datenx
				+ ", dateny=" + dateny + ", datenz=" + datenz + ", fahrradart="
				+ fahrradart + ", periodennr=" + periodennr + "]";
	}

}
